1. Field of the Invention
This invention relates to object-oriented programming and, more specifically, to the interactive connection of distributed objects to a graphic user interface (GUI).
2. Background
A software application typically includes a GUI that provides an interface between an application user and the application. In an object-oriented environment, the GUI uses GUI objects to control the fields in the GUI. To use the data input via the GUI, an application object is connected to the GUI object Data entered in a GUI field is forwarded to the application object via the connection formed between the GUI object and the application object. In a distributed environment, the GUI object and application object can reside on different computer systems.
In the prior art, it is necessary to generate customized code for use by the software application to create the connection between the GUI object and the application object. This is a disadvantage because it makes the code more complicated and increases the cost in time associated with development of an application. The following provides a background of prior art development environments and the need to generate such custom code.
Development Environment
A GUI is typically created using a development environment. An example of a technology that provides a development environment is OpenStep. OpenStep(trademark) is an open, high-volume portable standard for object-oriented computing. It provides a standard application programming interface (API). The OpenStep specification is based on NeXTStep. NeXTStep(trademark) is an object-oriented operating system of NeXT Software, Inc.
The NeXTStep environment runs in the Mach operating system (OS). The Mach OS is a microkernel-based operating systems. A microkernel-based OS provides a basic level of services with the bulk of the operating system services supplied by user-level services. For example, the Mach kernel provides process management, memory management, communication and Input/Output services. Services such as files and directories are handled by user-level processes.
Solaris(trademark) is a UNIX operating environment that can run on multiple hardware platforms such as Intel x86, SPARC, and PowerPC processors. OpenWindows(trademark) is a windowing system based on the X11 windowing specification that runs in Solaris. The X11/DPS is a windowing system that runs in OpenWindows. Solaris, OpenWindows, and X11/DPS are products that are available from Sun Microsystems, Inc. (Sun Microsystems, Inc., OpenWindows, X11/DPS, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and certain other countries.) An implementation of OpenStep runs in the Solaris operating environment.
Development Tools
A development environment such as that provided by OpenStep includes tools that can be used to develop a software application. Examples of such tools are: InterfaceBuilder (IB) and ProjectBuilder (PB).
The PB is a tool that can be used to logically group, connect, and manage the files and components of an application. A project file contains all of the information about the end product (e.g., a software application). A project can be a stand-alone application, a subproject that is contained within another project, a bundle that contains resources that can be used by other applications, for example.
The IB is a tool that can be used to build a GUI for an application. It assists in the design and definition of the presentation layer of an application. The IB provides a GUI that allows a developer to drag objects such as text fields, radio buttons, and custom views to the application window. The IB saves an application""s objects in a file referred to as a pickled object file (e.g., a nib file).
The IB also allows the developer to make connections between the application""s interface and other application objects. A connection can be used to send a message between an interface object and another object, for example. A connection is typically made by defining an outlet. An outlet is an instance variable in an Objective-C class that can store a pointer to another object (e.g., type xe2x80x9cidxe2x80x9d). The value of the instance variable is typically set to the xe2x80x9cidxe2x80x9d of an object in the nib file such as a GUI object. When an outlet is set to the xe2x80x9cidxe2x80x9d of an object, this is known as a connection.
Object Interface
An interface defines how an object can communicate, or interact, with another object. An interface defines an object""s type, attributes, the methods it exports, and the method parameters. An object that understands another object""s interface can generate a request for the other object to perform an operation.
Binding refers to the linking of the software interface to the code that implements the interface. Dynamic binding only requires that the interface be determined at the time a message is sent between the objects. In contrast, if the binding is static, the interface for the client and server is determined at compile or build time.
Typing refers to the identification of an object""s type, or class. Static typing requires that an object""s type be known at compile time. In contrast, it is not necessary to know the type, or class, of an object at compile-time if dynamic typing is used. Instead, an object""s type may be determined at run time.
Both C++ and Objective-C support dynamic, or run time, binding. However, C++ does not support dynamic typing. A C++ object""s type must be declared at compile time. In contrast, an Objective-C object""s type does not need to be available at compile time. Objective-C object typing can be dynamic (i.e., determined at run time).
Distributed Environment
Software applications can take advantage of a distributed computing capability referred to as distributed objects. Using distributed objects, a first object (a client object) can send a message to a second object (a server object) regardless of the physical location of either object. That is, the client and server objects can reside on different machines.
The distributed object technology uses a name server and a local proxy to allow a client object to communicate with a server object. A name server is used to register the server object. A client accesses the name server to look up the name of the server object. Using the name information, the client object directs a message to the server object.
Instead of going directly from the client to the server, the message is actually received by a proxy object that resides on the same machine as the client object. The proxy object forwards the message to the server object on the server object""s machine. A response generated by the server object is forwarded to the client object via the proxy object. The client object need not know the location of the server object. As far as the client object is concerned, the proxy object is the server object. However, the proxy object is only a vehicle for forwarding the message to the server object via the network. The details of the network communication is therefore hidden from the client object.
NEO provides a development environment and run time system for developing and deploying distributed objects on a CORBA infrastructure having an OpenStep GUI. The NEO product is intended for developing and delivering distributed object applications based on a CORBA-compliant infrastructure.
A CORBA object has an associated definition that is used to specify the object""s interface. The definition is parsed at run time and stored in a repository. A server provides access to the repository at run time to determine a CORBA object""s interface.
A CORBA object such as an object created using the NEO framework, a NEO object, is therefore dependent on a connection with the server. The connection to the server is not made while a developer is using the IB, but rather when a nib file is actually loaded at run time.
The applications developed using the NEO product use an OpenStep object-oriented GUI tool kit. The GUI tool kit contains Objective-C object classes. The IB provides the ability to connect an instance of a GUI tool kit Objective-C object class to another Objective-C object instance. For example, a GUI text field object that allows text entry such as an employee name is connected to an employee name Objective-C object that performs operations on the employee name.
Custom Code Generation
A developer typically uses an IB to create an object and establish a connection between the GUI object (e.g., text field object) and an application object (e.g., employee name Objective-C object). For example, a connection is formed by specifying an outlet of one object to point to another object. If the application object is an Objective-C object, it is not necessary to specify the outlet""s type statically (i.e., at build time). The type can be determined dynamically at run time. If, however, the application object is a C++ object, the outlet must have a static type that matches the run time type of the C++ application object. To match, the static type of the C++ application object can be the same type as, or a subclass of, the outlet""s type.
If the application object is a CORBA object, it is necessary to generate customized code that obtains the CORBA object from a name server and to form the connection between the GUI object and the CORBA object. The code generation is either performed by the application software developer or a development tool such as an IB. Customized code generation must be performed for each application which requires additional development time and expense. In addition, the use of customized code adds to the complexity of the application""s code.
A connection is dynamically created between a graphic user interface (GUI) and a statically typed, distributed object using the present invention. The connection is created without requiring a developer to write customized code or using a program development tool to generate customized code. Using the present invention, the connection is established dynamically at run time using declarative information specified at build time.
A template object is generated at build time that contains type and name information for a surrogate object. The surrogate object acts as a proxy for a distributed object (e.g., CORBA distributed object). At run time, the template object is used to identify the surrogate object. The surrogate object is connected to the GUI object at run time. The surrogate can be a statically-typed object. Thus, the present invention can be used to form a dynamic connection between a GUI object and a statically-typed object The GUI object is connected to the distributed object via the surrogate object.
The name information stored in the template object at build time is used to query a name server for an untyped surrogate object of a distributed object. The untyped surrogate object is transformed into a typed surrogate object at run time using the type information of the template object. A connection is formed between the typed surrogate object and the GUI object.